#Alexander F. Gazmararian
#afg2@princeton.edu
#January 9, 2024

#Purpose: Process natural gas production data for analysis of shale shock timing

#Load packages
library(tidyverse)
library(tidylog)
library(here)
library(lubridate)
library(readxl)

#load data
g <- read_xls(here("data", "input", "eia_naturalgasannual", "NG_PROD_SUM_A_EPG0_FGW_MMCF_A.xls"), sheet = 2, skip = 2)
#subset to relevant columns
g <- g[, c(1,2)]
#rename columns
names(g) <- c("year", "gasprod")
#code year to 4-digit date
g$year <- lubridate::year(g$year)
#save output
saveRDS(g, here("data", "input", "eia_naturalgasannual", "eia_nga.rds"))